package cn;

import cn.command.OpenCommandHandle;
import cn.util.PackageScanner;
import cn.util.TCUtil;
import cn.wetcland.dao.GlobalMarketDao;
import cn.wetcland.dao.WetclandPlayerDao;
import cn.wetcland.panel.menu.MainMenu;
import cn.wetcland.pojo.GlobalMarket;
import cn.wetcland.pojo.WetclandPlayer;
import cn.wetcland.service.LoginService;
import cn.wetcland.service.RegisterService;
import cn.wetcland.task.GlobalMarketUpdateTask;
import cn.wetcland.task.WorldResetTask;
import com.mcrmb.PayApi;
import com.tripleying.qwq.LocaleLanguageAPI.LocaleLanguageAPI;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.effect.*;
import me.yic.xconomy.XConomyAPI;
import multiworld.ConfigException;
import multiworld.MultiWorldPlugin;
import multiworld.api.MultiWorldAPI;
import multiworld.data.DataHandler;
import multiworld.data.InternalWorld;
import multiworld.data.WorldContainer;
import multiworld.data.WorldUtils;
import multiworld.worldgen.WorldGenerator;
import net.minecraft.server.v1_16_R3.BlockPosition;
import net.minecraft.server.v1_16_R3.NBTTagCompound;
import net.minecraft.server.v1_16_R3.PacketPlayOutOpenSignEditor;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.conversations.Conversation;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*;
import org.bukkit.event.Listener;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.Scoreboard;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TCSP extends JavaPlugin {

    public static SqlSessionFactory sqlSessionFactory;
    public static TCSP tcsp;
    public static Map<String, Object> playerAttr;
    public static Map<String, Boolean> marryAttr;
    public static YamlConfiguration signInYaml;
    public static YamlConfiguration basicYaml;
    public static YamlConfiguration serverBasicYaml;
    public static Inventory mainMenu = MainMenu.getMainMenu();
    public static Inventory landmarkMenu = MainMenu.getLandmarkMenu();
    public static Inventory marryMenu = MainMenu.getMarryMenu();
    public static Inventory serviceShoppingMenu = MainMenu.getServiceShoppingMenu();
    public static Inventory shortcutToolMenu = MainMenu.getShortcutToolMenu();
    public static XConomyAPI xConomyAPI = new XConomyAPI();
    public static Scoreboard mainScoreboard = null;
    public static EffectManager effectLib;

    @Override
    public void onEnable() {
        InputStream resourceAsStream = null;
        try {
            resourceAsStream = Resources.getResourceAsStream("mybaties-config.xml");
            getLogger().info("Mybaties 读取配置文件成功");
        } catch (IOException e) {
            e.printStackTrace();
            getLogger().warning("Mybaties 读取配置文件失败, 正在关闭服务器");
            Bukkit.getServer().shutdown();
        }
        YamlConfiguration yamlConfiguration = new YamlConfiguration();
        try {
            if (!new File("PlayerData/SignIn.yml").exists()) {
                yamlConfiguration.save("PlayerData/SignIn.yml");
                getLogger().warning("PlayerData/SignIn.yml 文件不存在， 已重新创建");
            }
            if (!new File("PlayerData/Basic.yml").exists()) {
                yamlConfiguration.save("PlayerData/Basic.yml");
                getLogger().warning("PlayerData/Basic.yml 文件不存在， 已重新创建");
            }
            if (!new File("WetclandServer/serverBasic.yml").exists()) {
                yamlConfiguration.save("WetclandServer/serverBasic.yml");
                getLogger().warning("WetclandServer/serverBasic.yml 文件不存在， 已重新创建");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(resourceAsStream);
        tcsp = this;
        playerAttr = new HashMap<>();
        marryAttr = new HashMap<>();
        getLogger().info("插件单例已创建, Mybaties 正常");
        new PackageScanner() {
            @Override
            public void dealClass(Class<?> klass) {
                getLogger().info("正在扫描监听器包...");
                System.out.println(klass);
                if (Arrays.asList(klass.getInterfaces()).contains(Listener.class)) {
                    try {
                        Bukkit.getPluginManager().registerEvents((Listener) klass.getConstructor().newInstance(), tcsp);
                    } catch (Exception e) {
                        e.printStackTrace();
                        getLogger().warning("监听器注册失败");
                    }
                }
            }
        }.scanPackage(getClassLoader(), "cn.listener");
        getLogger().info("监听器注册成功");
    }

    @Override
    public void onDisable() {
        getLogger().info("插件关闭");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        // 过滤控制台命令
        if (!(sender instanceof Player)) {
            return false;
        }
        Player player = (Player) sender;
        World world = player.getWorld();
        switch (label) {
            case "tc":
                switch (args[0]) {
                    case "npc":
                        if (!player.isOp()) return false;
                        CraftPlayer player1 = (CraftPlayer) player;
                        Location loc = player.getLocation();
                        Block blockAt = world.getBlockAt(loc);
                        blockAt.setType(Material.ACACIA_SIGN);
                        Sign sign = (Sign) blockAt.getState();
                        sign.setEditable(true);
                        PacketPlayOutOpenSignEditor packetPlayOutOpenSignEditor = new PacketPlayOutOpenSignEditor(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
                        player1.getHandle().playerConnection.sendPacket(packetPlayOutOpenSignEditor);
                        break;
                    case "get":
                        if (!player.isOp()) return false;
                        SqlSession sqlSession1 = sqlSessionFactory.openSession(true);
                        GlobalMarketDao mapper1 = sqlSession1.getMapper(GlobalMarketDao.class);
                        List<GlobalMarket> all = mapper1.findAll();
                        for (GlobalMarket globalMarket1 : all) {
                            System.out.println(Arrays.toString(globalMarket1.getItemByte()));
                            NBTTagCompound nbtTagCompound = TCUtil.convertByteArrToNBT(globalMarket1.getItemByte());
                            System.out.println(nbtTagCompound);
                            ItemStack itemStack = TCUtil.convertNBTTOItemStack(nbtTagCompound);
                            player.getInventory().addItem(itemStack);
                        }
                        sqlSession1.close();
                        break;
                    case "modifyTitle":
                        if (player.isConversing()) {
                            player.sendMessage("§c您有一个未完成的会话正在进行");
                            return false;
                        }
                        Conversation conversation = new Conversation(this, player, new StringPrompt() {
                            @Override
                            public String getPromptText(ConversationContext conversationContext) {
                                return "§a修改称号会话启动，您有1分钟时间修改称号(请确保您有1w金币)：步骤1 -> 按下T键输入称号文字(长度区间(0, 5])，步骤2 -> 按下回车确认";
                            }

                            @Override
                            public Prompt acceptInput(ConversationContext conversationContext, String s) {
                                player.sendTitle("§a您输入的称号文本为: " + s, "", 10, 10, 10);
                                if (s.length() > 5 || s.length() <= 0)
                                    player.sendTitle("§c您输入的称号长度不符合规范: " + s.length(), "", 10, 10, 10);
                                WetclandPlayer info = TCUtil.getAttrPlayer(player.getName());
                                XConomyAPI xConomyAPI = TCSP.getxConomyAPI();
                                double doubleValue = xConomyAPI.getbalance(xConomyAPI.translateUUID(player.getName())).doubleValue();
                                if (doubleValue < 10000) {
                                    player.sendTitle("§c非常抱歉，您的金币不足1w", "", 10, 10, 10);
                                    return Prompt.END_OF_CONVERSATION;
                                } else {
                                    // 扣款
                                    xConomyAPI.changebalance(xConomyAPI.translateUUID(player.getName()), player.getName(), BigDecimal.valueOf(10000), false);
                                    info.setTitle(s);
                                    SqlSession sqlSession = sqlSessionFactory.openSession(true);
                                    WetclandPlayerDao mapper = sqlSession.getMapper(WetclandPlayerDao.class);
                                    mapper.updatePlayer(info);
                                    sqlSession.close();
                                    player.sendTitle("§a会话结束, 修改称号成功", "", 10, 10, 10);
                                }
                                return Prompt.END_OF_CONVERSATION;
                            }
                        });
                        Bukkit.getScheduler().runTaskLater(this, () -> {
                            if (player.isConversing()) {
                                conversation.abandon();
                                player.sendMessage("§a会话结束");
                            }
                        }, 20 * 60);
                        player.beginConversation(conversation);
                        break;
                    case "marry":
                        if (args.length < 2) return false;
                        switch (args[1]) {
                            case "accept":
                                String wooer = args[2];
                                if (marryAttr.get(wooer) == null) {
                                    player.sendMessage("§c结婚请求已过期");
                                    return false;
                                } else {
                                    player.sendMessage("§a你已同意" + wooer + "的求婚");
                                    Bukkit.getPlayer(wooer).sendMessage("§a" + player.getName() + "已接受了你的求婚");
                                    Bukkit.broadcastMessage("§a================");
                                    Bukkit.broadcastMessage("§b恭喜" + wooer + " - " + player.getName() + "喜结连理");
                                    Bukkit.broadcastMessage("§a================");
                                    // 向玩家播放花海BGM
                                    player.playSound(player.getLocation(), "wetcland.bgm_huahai", 5f, 1f);
                                    Player player2 = Bukkit.getPlayer(wooer);
                                    if (player2 != null && player2.isOnline()) {
                                        player2.playSound(player.getLocation(), "wetcland.bgm_huahai", 5f, 1f);
                                    }
                                }
                                WetclandPlayer attrPlayer1 = TCUtil.getAttrPlayer(wooer);
                                WetclandPlayer attrPlayer = TCUtil.getAttrPlayer(player.getName());
                                attrPlayer.setMarried(true);
                                attrPlayer.setCompanionId(attrPlayer1.getId());
                                attrPlayer1.setMarried(true);
                                attrPlayer1.setCompanionId(attrPlayer.getId());
                                SqlSession sqlSession = sqlSessionFactory.openSession(true);
                                WetclandPlayerDao mapper = sqlSession.getMapper(WetclandPlayerDao.class);
                                mapper.updatePlayer(attrPlayer);
                                mapper.updatePlayer(attrPlayer1);
                                sqlSession.close();
                                marryAttr.remove(wooer);
                                break;
                            case "refuse":
                                String wooer1 = args[2];
                                if (marryAttr.get(wooer1) == null) {
                                    player.sendMessage("§c结婚请求已过期");
                                    return false;
                                } else {
                                    player.sendMessage("§a你已拒绝" + wooer1 + "的求婚");
                                    Bukkit.getPlayer(wooer1).sendMessage("§a" + player.getName() + "已拒绝了你的求婚");
                                    // 向玩家播放花海BGM
                                    player.playSound(player.getLocation(), "wetcland.bgm_yijianmei", 5f, 1f);
                                    Player player2 = Bukkit.getPlayer(wooer1);
                                    if (player2 != null && player2.isOnline()) {
                                        player2.playSound(player.getLocation(), "wetcland.bgm_yijianmei", 5f, 1f);
                                    }
                                }
                                marryAttr.remove(wooer1);
                                break;
                            case "divorce":
                            {
                                WetclandPlayer wetclandPlayer = TCUtil.getAttrPlayer(player.getName());
                                if (!wetclandPlayer.isMarried()) {
                                    player.sendMessage("§c您还未结婚");
                                    return false;
                                }
                                XConomyAPI xConomyAPI = TCSP.getxConomyAPI();
                                double v = xConomyAPI.getbalance(xConomyAPI.translateUUID(player.getName())).doubleValue();
                                if (v < 10000) {
                                    player.sendMessage("§c您的金币不足10000");
                                    return false;
                                }
                                xConomyAPI.changebalance(xConomyAPI.translateUUID(player.getName()), player.getName(), BigDecimal.valueOf(10000), false);
                                int companionId = wetclandPlayer.getCompanionId();
                                wetclandPlayer.setMarried(false);
                                wetclandPlayer.setCompanionId(0);
                                SqlSession sqlS = TCSP.getSqlSessionFactory().openSession(true);
                                WetclandPlayerDao mapper2 = sqlS.getMapper(WetclandPlayerDao.class);
                                WetclandPlayer oneById = mapper2.findOneById(companionId);
                                oneById.setMarried(false);
                                oneById.setCompanionId(0);
                                mapper2.updatePlayer(wetclandPlayer);
                                mapper2.updatePlayer(oneById);
                                sqlS.close();
                                player.sendMessage("§c您已与 " + oneById.getPlayerName() + " 离婚");
                                player.playSound(player.getLocation(), "wetcland.bgm_yishengweini", 5f, 1f);
                                Player player2 = Bukkit.getPlayer(oneById.getPlayerName());
                                if (player2 != null && player2.isOnline()) {
                                    WetclandPlayer attrPlayer2 = TCUtil.getAttrPlayer(player2.getName());
                                    attrPlayer2.setCompanionId(0);
                                    attrPlayer2.setMarried(false);
                                    player2.sendMessage("§c" + player.getName() + " 已与您离婚");
                                    player2.playSound(player.getLocation(), "wetcland.bgm_yishengweini", 5f, 1f);
                                }
                                break;
                            }
                        }
                        break;
                    case "test":
                        if (!player.isOp()) return false;
                        ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
                        System.out.println(LocaleLanguageAPI.getItemName(itemInMainHand));
                        System.out.println(PayApi.look(player.getName()));
                        System.out.println(itemInMainHand.getType().name());
                        break;
                    case "world":
                        if (!player.isOp()) return false;
                        PluginManager pluginManager = Bukkit.getPluginManager();
                        Plugin[] plugins = pluginManager.getPlugins();
                        for (Plugin plugin : plugins) {
                            System.out.println(plugin.getName());
                        }
                        Plugin multiWorld = pluginManager.getPlugin("MultiWorld");
                        MultiWorldAPI multiWorldAPI = new MultiWorldAPI((MultiWorldPlugin) multiWorld);
                        WorldGenerator normal = WorldGenerator.NORMAL;
                        try {
                            DataHandler dataHandler = new DataHandler(multiWorld.getConfig(), (MultiWorldPlugin) multiWorld);
                            WorldUtils worldManager = dataHandler.getWorldManager();
                            InternalWorld[] loadedWorlds = worldManager.getLoadedWorlds();
                            for (InternalWorld internalWorld:loadedWorlds) {
                                System.out.println(internalWorld.getName());
                            }
                            WorldContainer worldContainer = worldManager.getWorldMeta("TestWorld", false);
                            worldContainer.setLoaded(true);
                            worldContainer.loadWorld();
                            worldContainer.setWorld(worldManager.getInternalWorld("TestWorld", false));
                            worldManager.unloadWorld("TestWorld");
                            worldManager.deleteWorld("TestWorld");
                            dataHandler.scheduleSave();
                        } catch (ConfigException e) {
                            e.printStackTrace();
                        }
                        break;
                    case "master":
                        // 执行此命令必须要是管理员
                        if (!player.isOp()) {
                            player.sendMessage("§c本命令只限管理员使用");
                            return false;
                        }
                        if (args.length < 2) return false;
                        switch (args[1]) {
                            case "intensifier":
                            {
                                ArmorStand armorStand = (ArmorStand) world.spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
                                armorStand.setBasePlate(false);
                                armorStand.setArms(true);
                                EntityEquipment equipment = armorStand.getEquipment();
                                assert equipment != null;
                                equipment.setItemInMainHand(new ItemStack(Material.CREEPER_HEAD));
                                equipment.setHelmet(new ItemStack(Material.ZOMBIE_HEAD));

                                ItemStack itemStack = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
                                itemStack.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setChestplate(itemStack);
                                ItemStack itemStack1 = new ItemStack(Material.CHAINMAIL_LEGGINGS);
                                itemStack1.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setLeggings(itemStack1);
                                ItemStack itemStack2 = new ItemStack(Material.CHAINMAIL_BOOTS);
                                itemStack2.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setBoots(itemStack2);

                                armorStand.setCustomName("§d[至尊]§b强化大师");
                                armorStand.setCustomNameVisible(true);
                                armorStand.setVisible(true);
                                break;
                            }
                            case "refiner":
                            {
                                ArmorStand armorStand = (ArmorStand) world.spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
                                armorStand.setBasePlate(false);
                                armorStand.setArms(true);
                                EntityEquipment equipment = armorStand.getEquipment();
                                assert equipment != null;
                                equipment.setItemInMainHand(new ItemStack(Material.PLAYER_HEAD));
                                equipment.setHelmet(new ItemStack(Material.CREEPER_HEAD));

                                ItemStack itemStack = new ItemStack(Material.DIAMOND_CHESTPLATE);
                                itemStack.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setChestplate(itemStack);
                                ItemStack itemStack1 = new ItemStack(Material.DIAMOND_LEGGINGS);
                                itemStack1.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setLeggings(itemStack1);
                                ItemStack itemStack2 = new ItemStack(Material.DIAMOND_BOOTS);
                                itemStack2.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setBoots(itemStack2);
                                armorStand.setCustomName("§d[至尊]§b淬炼大师");
                                armorStand.setCustomNameVisible(true);
                                armorStand.setVisible(true);
                                break;
                            }
                            case "leveler":
                            {
                                ArmorStand armorStand = (ArmorStand) world.spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);
                                armorStand.setBasePlate(false);
                                armorStand.setArms(true);
                                EntityEquipment equipment = armorStand.getEquipment();
                                assert equipment != null;
                                equipment.setItemInMainHand(new ItemStack(Material.ZOMBIE_HEAD));
                                equipment.setHelmet(new ItemStack(Material.PLAYER_HEAD));

                                ItemStack itemStack = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
                                itemStack.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setChestplate(itemStack);
                                ItemStack itemStack1 = new ItemStack(Material.CHAINMAIL_LEGGINGS);
                                itemStack1.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setLeggings(itemStack1);
                                ItemStack itemStack2 = new ItemStack(Material.CHAINMAIL_BOOTS);
                                itemStack2.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                                equipment.setBoots(itemStack2);
                                armorStand.setCustomName("§d[至尊]§b等级大师");
                                armorStand.setCustomNameVisible(true);
                                armorStand.setVisible(true);
                                break;
                            }
                        }
                        break;
                    case "open":
                        if (args.length < 2) return false;
                        switch (args[1]) {
                            case "globalMarket":
                                OpenCommandHandle.openGlobalMarket(player);
                                break;
                        }
                        break;
                    case "location":
                        if (!player.isOp()) return false;
                        if (args.length > 1) {
                            TCUtil.saveLocationInYaml(args[1], player.getLocation());
                            player.sendMessage("§a保存成功");
                        }
                        break;
                    case "eff":
                        if (args.length < 2 && player.isOp()) return false;
                        switch (args[1]) {
                            case "1":
                                AnimatedBallEffect animatedBallEffect = new AnimatedBallEffect(effectLib);
                                animatedBallEffect.setLocation(player.getLocation());
                                animatedBallEffect.start();
                                break;
                            case "2":
                                ArcEffect arcEffect = new ArcEffect(effectLib);
                                arcEffect.setLocation(player.getLocation());
                                arcEffect.start();
                                break;
                            case "3":
                                AtomEffect atomEffect = new AtomEffect(effectLib);
                                atomEffect.setLocation(player.getLocation());
                                atomEffect.infinite();
                                atomEffect.start();
                                break;
                            case "4":
                                BigBangEffect bigBangEffect = new BigBangEffect(effectLib);
                                bigBangEffect.setLocation(player.getLocation());
                                bigBangEffect.start();
                                break;
                            case "5":
                                BleedEffect bleedEffect = new BleedEffect(effectLib);
                                bleedEffect.setLocation(player.getLocation());
                                bleedEffect.start();
                                break;
                            case "6":
                                CloudEffect cloudEffect = new CloudEffect(effectLib);
                                cloudEffect.setLocation(player.getLocation());
                                cloudEffect.start();
                                break;
                        }
                        break;
                }
                break;
            case "login":
                new LoginService(player, args[0]);
                break;
            case "reg":
                new RegisterService(player, args);
                break;
        }
        return true;
    }

    public static SqlSessionFactory getSqlSessionFactory() {
        return sqlSessionFactory;
    }

    public static void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        TCSP.sqlSessionFactory = sqlSessionFactory;
    }

    public static TCSP getTcsp() {
        return tcsp;
    }

    public static void setTcsp(TCSP tcsp) {
        TCSP.tcsp = tcsp;
    }

    public static Map<String, Object> getPlayerAttr() {
        return playerAttr;
    }

    public static void setPlayerAttr(Map<String, Object> playerAttr) {
        TCSP.playerAttr = playerAttr;
    }

    public static Map<String, Boolean> getMarryAttr() {
        return marryAttr;
    }

    public static void setMarryAttr(Map<String, Boolean> marryAttr) {
        TCSP.marryAttr = marryAttr;
    }

    public static YamlConfiguration getSignInYaml() {
        return signInYaml;
    }

    public static void setSignInYaml(YamlConfiguration signInYaml) {
        TCSP.signInYaml = signInYaml;
    }

    public static YamlConfiguration getBasicYaml() {
        return basicYaml;
    }

    public static void setBasicYaml(YamlConfiguration basicYaml) {
        TCSP.basicYaml = basicYaml;
    }

    public static YamlConfiguration getServerBasicYaml() {
        return serverBasicYaml;
    }

    public static void setServerBasicYaml(YamlConfiguration serverBasicYaml) {
        TCSP.serverBasicYaml = serverBasicYaml;
    }

    public static Inventory getMainMenu() {
        return mainMenu;
    }

    public static void setMainMenu(Inventory mainMenu) {
        TCSP.mainMenu = mainMenu;
    }

    public static Inventory getLandmarkMenu() {
        return landmarkMenu;
    }

    public static void setLandmarkMenu(Inventory landmarkMenu) {
        TCSP.landmarkMenu = landmarkMenu;
    }

    public static Inventory getMarryMenu() {
        return marryMenu;
    }

    public static void setMarryMenu(Inventory marryMenu) {
        TCSP.marryMenu = marryMenu;
    }

    public static Inventory getServiceShoppingMenu() {
        return serviceShoppingMenu;
    }

    public static void setServiceShoppingMenu(Inventory serviceShoppingMenu) {
        TCSP.serviceShoppingMenu = serviceShoppingMenu;
    }

    public static Inventory getShortcutToolMenu() {
        return shortcutToolMenu;
    }

    public static void setShortcutToolMenu(Inventory shortcutToolMenu) {
        TCSP.shortcutToolMenu = shortcutToolMenu;
    }

    public static XConomyAPI getxConomyAPI() {
        return xConomyAPI;
    }

    public static void setxConomyAPI(XConomyAPI xConomyAPI) {
        TCSP.xConomyAPI = xConomyAPI;
    }

    public static EffectManager getEffectLib() {
        return effectLib;
    }

    public static void setEffectLib(EffectManager effectLib) {
        TCSP.effectLib = effectLib;
    }
}
